<%@ page import="com.onlineOrder.bean.shopList" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: 12296
  Date: 2022/3/7
  Time: 8:56
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>商家管理</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" >
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap-theme.min.css" >
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js" ></script>
</head>
<script type="text/javascript">
    function shopDelete(shopID){
        var ok = window.confirm("删了不可恢复！");
        if(ok){
            document.location.href = "<%=request.getContextPath()%>/adminShopDelete?shopID=" + shopID;
        }
    }
</script>
<body>
<div class="container row=10">
    <table class="table table-striped table-bordered table-hover">
        <tbody>
        <tr>
            <th>      </th>
            <th>商家账号</th>
            <th>商铺名称</th>
            <%--            <th>总营收</th>--%>
            <th>法人代表</th>
            <th>手机号</th>
            <%--            <th>法人信息</th>--%>
            <%--            <th>商铺地址</th>--%>
            <th>运营状态</th>
            <th>注册状态</th>
            <th>      </th>
        </tr>

        <%--    <%%>--%>
        <%--    <%=%>--%>

        <%
            List<shopList> shopListList = (List<shopList>)request.getAttribute("shopList");
            //循环遍历
            int i=0;
            for (shopList shopList:shopListList){
        %>

        <%
            String register="";
            if (shopList.getRegister().equals("1")){
                register="已注册";
            }else {
                register="待审批";
            }
        %>

        <tr>
            <td><%=++i%></td>
            <td><%=shopList.getShopId()%></td>
            <td><%=shopList.getShopName()%></td>
            <%--            <td><%=shopList.getSale()%></td>--%>
            <td><%=shopList.getOwner()%></td>
            <td><%=shopList.getPhone()%></td>
            <%--            <td><%=shopList.getMessage()%></td>--%>
            <%--            <td><%=shopList.getAddress()%></td>--%>
            <td><%=shopList.getState()%></td>
            <td><%=register%></td>
            <td>
                <input class="btn btn-info"   type="button" value="详情" onclick="window.location.href='<%=request.getContextPath()%>/adminShopDetail?shopID=<%=shopList.getShopId()%>'">
                <input class="btn btn-danger" type="button" value="删除" onclick="shopDelete(<%=shopList.getShopId()%>)">
            </td>
        </tr>

        <%
            }
        %>

        </tbody>
    </table>
</div>
</body>
</html>
